package com.jweb.framework.ws.soap.axiom;

import javax.xml.transform.Result;

import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMException;
import org.apache.axiom.soap.SOAPFactory;
import org.springframework.ws.soap.SoapFaultDetailElement;
import org.springframework.xml.transform.StaxResult;
/**
 * 修改人： Thomas
 * 修改内容：新增 
 * 类说明：
 */
class AxiomSoapFaultDetailElement extends AxiomSoapElement implements SoapFaultDetailElement {
	
	public AxiomSoapFaultDetailElement(OMElement axiomElement , SOAPFactory axiomFactory){
		super(axiomElement, axiomFactory);
	}
	
	public Result getResult(){
		try {
			return new StaxResult(new DXMLStreamWriter(getAxiomElement(), getAxiomFactory()));
		} catch (OMException e) {
			throw new AxiomSoapFaultException(e);
		}
	}
	
	public void addText(String text) {
		try {
			getAxiomElement().setText(text);
		} catch (OMException e) {
			throw new AxiomSoapFaultException(e);
		}
	}
	
}
